package June02;

public class T01Employee {
    //1.标准的javabean具有以下特征
    //类名见名知意
    //所有成员变量都需要私有
    //构造方法（空参 带全部参数的构造）
    //get/set方法

    private String id;
    private String name;
    private double salary;


    public T01Employee() {
    }

    public T01Employee(String id, String name, double salary) {
        this.id = id;
        this.name = name;
        this.salary = salary;
    }

    /**
     * 获取
     * @return id
     */
    public String getId() {
        return id;
    }

    /**
     * 设置
     * @param id
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * 获取
     * @return name
     */
    public String getName() {
        return name;
    }

    /**
     * 设置
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取
     * @return salary
     */
    public double getSalary() {
        return salary;
    }

    /**
     * 设置
     * @param salary
     */
    public void setSalary(double salary) {
        this.salary = salary;
    }

    public String toString() {
        return "员工信息{工号 = " + id + ", 姓名 = " + name + ", 工资 = " + salary + "}";
    }

    public void work(){
        System.out.println("员工在工作");
    }
    public void eat(){
        System.out.println("员工在吃饭");
    }

}
